<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<s:layout-render name="/layout_template.jsp" nadpis="user.createNew">
    <s:layout-component name="telo">
        <s:useActionBean beanclass="cz.muni.fi.pa165.carparkweb.actionbeans.AuthorizationActionBean" var="actionBean"/> 
        <s:form beanclass="cz.muni.fi.pa165.carparkweb.actionbeans.AuthorizationActionBean">
            <s:hidden name="user.id"/>     
            <div id="form">
                <%@include file="/WEB-INF/jsp/userForm.jsp"%>
                <div class="submit">
                    <s:submit name="createUser"><f:message key="user.createNew" /></s:submit>
                </div>

            </s:form> 
        </div>
        <div style="margin-top: 190px;">
            <c:if test="${actionBean.userCreated}">
                <h2><f:message key="user.existName"/>
                    <c:out value=" ${actionBean.user.userName} "/>
                    <f:message key="user.existPassword"/>
                    <c:out value=" ${actionBean.user.password} "/>
                    <f:message key="user.created"/>
                </h2>
            </c:if>
            <c:if test="${actionBean.userExists}">
                <h2 style="color: red">
                    <f:message key="user.existName"/>
                    <c:out value=" ${actionBean.user.userName} "/>
                    <f:message key="user.existPassword"/>
                    <c:out value=" ${actionBean.user.password} "/>
                    <f:message key="user.exist"/>
                </h2>
            </c:if>
        </div>

    </s:layout-component>
</s:layout-render>